<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="layui/css/layui.css" media="all" rel="stylesheet">
</head>
<body>
<div class="layui-container" style="margin-top: 50px;">

    <div class="layui-container" style="width: 500px;height: 330px;padding-top: 60px;">
        <form action="/menu/save" class="layui-form" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">姓名：</label>
                <div class="layui-inline">
                    <input autocomplete="off" class="layui-input" lay-verify="required" name="name" placeholder="请输入姓名"
                           type="text">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">性别：</label>
                <div class="layui-inline">
                    <input checked name="sex" title="男" type="radio" value="male">
                    <input name="sex" title="女" type="radio" value="female">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">电话：</label>
                <div class="layui-inline">
                    <input autocomplete="off" class="layui-input" name="phone" placeholder="请输入电话" type="text">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">邮箱：</label>
                <div class="layui-inline">
                    <input autocomplete="off" class="layui-input" name="email" placeholder="请输入邮箱" type="text">
                </div>
            </div>
            <div class="layui-form-item">
                <button class="layui-btn" lay-filter="demo2" lay-submit="" style="margin-left: 160px;">确认修改</button>
            </div>
        </form>
    </div>
</div>
<script charset="utf-8" src="layui/layui.js"></script>
<script>
    layui.use(['form', 'element'], function () {
        var form = layui.form;
        var element = layui.element;

        //自定义验证规则
        form.verify({
            price: [/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/, "请输入正确的价格"]
        });

    });
</script>
</body>
</html>